package unit.entity;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import am.bll.entity.BookConfig;
import am.bll.entity.basic.Money;

public class BookConfigTester
{

    @Before
    public void setUp() throws Exception
    {
    }

    @After
    public void tearDown() throws Exception
    {
    }

    @Test
    public void testConstructor()
    {
        // case01: 默认值

        // case02: 一般
        BookConfig b02 = new BookConfig();
        b02.setID(23);
        b02.setDefaultUnit('$');
        b02.setDayBudget(new Money("123.3"));
        b02.setMonthBudget(new Money("8345.3"));
        b02.setOpenDayWarn(false);
        b02.setOpenMonthWarn(false);

        assertEquals(23, b02.getID());
        assertEquals('$', b02.getDefaultUnit());
        assertTrue(b02.getDayBudget().compare(new Money("123.3")) == 0);
        assertTrue(b02.getMonthBudget().compare(new Money("8345.30")) == 0);
        assertEquals(b02.getOpenDayWarn(), false);
        assertEquals(b02.getOpenMonthWarn(), false);
    }
}
